set TYPEMOCKPATH=%programfiles(x86)%\Typemock\Isolator\
set TYPEMOCKV=6.1

IF NOT EXIST "%TYPEMOCKPATH%%TYPEMOCKV%\TMockRunner.exe" (set TYPEMOCKV=6.2)
IF EXIST "%TYPEMOCKPATH%%TYPEMOCKV%\TMockRunner.exe" (GOTO TYPEMOCKFOUND) ELSE (GOTO TYPEMOCKNOTFOUND) 

:TYPEMOCKFOUND
ECHO "TypeMock %TYPEMOCKV% found"

set NUNITV=2.5.5
set NUNITBINPATH=bin\net-2.0\nunit.exe

if NOT EXIST "%programfiles(x86)%\NUnit %NUNITV%\%NUNITBINPATH%" (set NUNITV=2.5.8)
if NOT EXIST "%programfiles(x86)%\NUnit %NUNITV%\%NUNITBINPATH%" (set NUNITV=2.5.10)
if EXIST "%programfiles(x86)%\NUnit %NUNITV%\%NUNITBINPATH%" (GOTO NUNITFOUND) ELSE (GOTO NUNITNOTFOUND)

:NUNITFOUND
ECHO "NUnit %NUNITV% found"
"%TYPEMOCKPATH%%TYPEMOCKV%\TMockRunner.exe" "%programfiles(x86)%\NUnit %NUNITV%\%NUNITBINPATH%" allTests.nunit
GOTO END

:NUNITNOTFOUND
ECHO "NUnit not found"
GOTO END

:TYPEMOCKNOTFOUND) 
ECHO "TypeMock not found"
GOTO END

:END